package com.whater.sso.client.rest.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.whater.common.domain.AjaxResult;
import com.whater.sso.client.service.ImageService;

import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("wechat")
@Slf4j
public class WeChatController {
	
	@Autowired
	private ImageService imageService;

	@GetMapping("listPath")
	public AjaxResult listPath(@RequestParam(name = "path") String path) {
		return AjaxResult.success(imageService.getPath(path));
	}

	@GetMapping("listImage")
	public AjaxResult listImage(@RequestParam(name = "path") String path,
			@RequestParam(name = "skip") Integer skip,
			@RequestParam(name = "limit") Integer limit) {
		return AjaxResult.success(imageService.getImage(path,skip,limit));
	}

}
